﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace GreetingWCFService
{
    [DataContract]
    [XmlRoot(ElementName="GraphicElement", Namespace="")]    
    public class GraphicElementData : INotifyPropertyChanged
    {
        #region Constructors

        public GraphicElementData()
        { }

        #endregion Constructors
        #region INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        #endregion INotifyPropertyChanged
        #region Properties

        private string _content = string.Empty;
        [DataMember]
        public string Content
        {
            get { return _content; }
            set 
            {
                if (value != _content)
                {
                    _content = value;
                    NotifyPropertyChanged("Content");
                }
            }
        }

        private string _templateName = string.Empty;
        [DataMember]
        public string TemplateName 
        {
            get { return _templateName; }
            set
            {
                if (value != _templateName)
                {
                    _templateName = value;
                    NotifyPropertyChanged("TemplateName");
                }
            }
        }

        private double _positionX = 0.0;
        [DataMember]
        public double PositionX
        {
            get { return _positionX; }
            set
            {
                if (value != _positionX)
                {
                    _positionX = value;
                    NotifyPropertyChanged("PositionX");
                }
            }
        }

        private double _positionY = 0.0;
        [DataMember]
        public double PositionY
        {
            get { return _positionY; }
            set
            {
                if (value != _positionY)
                {
                    _positionY = value;
                    NotifyPropertyChanged("PositionY");
                }
            }
        }

        private double _angle = 0.0;
        [DataMember]
        public double Angle
        {
            get { return _angle; }
            set
            {
                if (value != _angle)
                {
                    _angle = value;
                    NotifyPropertyChanged("Angle");
                }
            }
        }

        private double _scale = 1.0;
        [DataMember]
        public double Scale
        {
            get { return _scale; }
            set
            {
                if (value != _scale)
                {
                    _scale = value;
                    NotifyPropertyChanged("Scale");
                }
            }
        }

        private double _width = 0.0;
        [DataMember]
        public double Width
        {
            get { return _width; }
            set
            {
                if (value != _width)
                {
                    _width = value;
                    NotifyPropertyChanged("Width");
                }
            }
        }

        private double _height = 0.0;
        [DataMember]
        public double Height
        {
            get { return _height; }
            set
            {
                if (value != _height)
                {
                    _height = value;
                    NotifyPropertyChanged("Height");
                }
            }
        }

        #endregion Properties
    }
}
